<?php

namespace app\common\validate;


class WxStatistics extends BaseValidate {
    protected $rule = [
        'type' => 'require|belongToList'
    ];
    protected $message = [
        'type' => '类型错误'
    ];

    protected function belongToList($value) {
        $belongToList = ['dailysummarytrend', 'dailyvisittrend', 'weeklyvisittrend', 'monthlyvisittrend', 'visitdistribution', 'dailyretaininfo', 'weeklyretaininfo', 'monthlyretaininfo', 'visitpage'];
        if (in_array($value, $belongToList)) {
            return true;
        } else {
            return false;
        }
    }
}